package com.web.words;

import com.bean.Words;
import com.service.WordsService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class DeleteWordsServlet extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Words words = new Words();
        WordsService service = new WordsService();
       int id=Integer.valueOf(req.getParameter("id"));

        service.deletewords(id);
        req.getRequestDispatcher("/ListWords").forward(req,resp);

    }
}
